package com.baidu.aip.sample;

import com.baidu.aip.util.HttpUtil;

public class UnitSample {
	 public static String utterance() {
	        // 请求URL
	        String talkUrl = "https://aip.baidubce.com/rpc/2.0/solution/v1/unit_utterance";
	        try {
	            // 请求参数
	            String params = "{\"scene_id\":1234,\"session_id\":\"\",\"query\":\"" + "好看的科幻片" + "\"}";
//	            String accessToken = "#####调用鉴权接口获取的token#####";
	            String accessToken = AuthService.getAuth();
	            String result = HttpUtil.post(talkUrl, accessToken, "application/json", params);
	            return result;
	        } catch (Exception e) {
	            e.printStackTrace();
	        }
	        return null;
	    }
	public static void main(String[] args) {
		UnitSample.utterance();
	}

}
